﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using aoprinter;
using aoprinter.Model;

namespace aoprinter.Test
{
    abstract class TestPrinter
    {
        private AOPrinter _printer = new AOPrinter();
        private ModPrinterSetting _setting = new ModPrinterSetting();

        public TestPrinter()
        {
            _setting.PageSetting = new System.Drawing.Printing.PageSettings();
            _setting.PrinterSetting = new System.Drawing.Printing.PrinterSettings();
        }

        public void SetData(string xmlPath)
        {
            if (_printer != null)
            {
                _printer.ClearDrawPage();
            }
            _printer = new AOPrinter();
            _printer.SetData(xmlPath, GetData(), _setting);
        }

        public void Print()
        {
            _printer.Print();
        }

        public ModReport Report
        {
            get
            {
                return _printer.GetReport();
            }
        }

        public PrintDocument Document
        {
            get
            {
                return _printer.Document;
            }
        }

        public ModPrinterSetting PrinterSetting
        {
            get
            {
                return _setting;
            }
        }

        abstract public PrinterData GetData();
    }
}
